package com.ibeeking.found.file.rest.service.office.documentserver.callbacks;

import com.ibeeking.found.file.rest.service.office.dto.Track;
import org.springframework.beans.factory.annotation.Autowired;

import javax.annotation.Resource;

// specify the callback handler functions
public interface Callback {

    int handle(Track body, String fileName);  // handle the callback

    int getStatus();  // get document status

    @Resource
    default void selfRegistration(CallbackHandler callbackHandler){  // register a callback handler
        callbackHandler.register(getStatus(), this);
    }
}
